<include file="Public:head" />
<style>
    tr td{
        text-align: center;
    }
    .dannum{
        width: 300px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: inline-block;
    }
</style>
<body class="overflow-hidden">
<div class="wrapper preload">
    <include file="Public:header" />
    <include file="Public:left" />

    <div class="main-container">
        <div class="padding-md">
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title">
                        学校所属学科管理
                    </div>
                </div>
            </div>
            <div class="col-sm-12 row chach">
                <button class="action-button" type="button" onclick="type_add()">新增</button>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="smart-widget widget-green">
                        <div class="smart-widget-header row ">
                            <span class="smart-widget-option">
                                <span class="refresh-icon-animated">
                                    <i class="fa fa-spinner fa-spin" style="color:#fff"></i>
                                </span>
                                <a href="#" class="widget-toggle-hidden-option">
                                </a>
                                <a href="#" class="widget-collapse-option" data-toggle="collapse">
                                </a>
                                <a href="#" class="widget-refresh-option">
                                </a>
                            </span>
                        </div>
                        <div class="smart-widget-inner table-responsive">
                            <div class="smart-widget-hidden-section">
                                <ul class="widget-color-list clearfix">
                                    <li style="background-color:#20232b;" data-color="widget-dark"></li>
                                    <li style="background-color:#4c5f70;" data-color="widget-dark-blue"></li>
                                    <li style="background-color:#23b7e5;" data-color="widget-blue"></li>
                                    <li style="background-color:#1fb5ac;" data-color="widget-green"></li>
                                    <li style="background-color:#edbc6c;" data-color="widget-yellow"></li>
                                    <li style="background-color:#fbc852;" data-color="widget-orange"></li>
                                    <li style="background-color:#e36159;" data-color="widget-red"></li>
                                    <li style="background-color:#7266ba;" data-color="widget-purple"></li>
                                    <li style="background-color:#f5f5f5;" data-color="widget-light-grey"></li>
                                    <li style="background-color:#fff;" data-color="reset"></li>
                                </ul>
                            </div>
                            <table class="table table-striped no-margin">
                                <thead>
                                <tr>
                                    <!--<th class="text-center" style="width: 80px"><input class="check-all" type="checkbox"></th>-->
                                    <th class="text-center " style="width: 200px">序号</th>
                                    <th class="text-center" >学科名称</th>
                                    <th class="text-center" >状态</th>
                                    <th class="text-center" style="width: 300px">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <notempty name="_list">
                                    <volist name="_list" id="vo" key="k">
                                        <tr>
                                            <!--<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>-->
                                            <td><?php echo ((($_GET['p']?$_GET['p']:1)-1)*10+$k)?></td>
                                            <td><a href="{:U('SchoolType/more',array('id'=>$vo['id']))}">{$vo.title}</a></td>
                                            <td>{$vo.status|getStatus}</td>
                                            <td>
                                                <a href="#" onclick="type_add('{$vo[title]}',{$vo[id]},'{$vo[status]}')">编辑</a>
                                                <a href="{:U('SchoolType/del?id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    <else/>
                                    <td colspan="5" class="text-center"> aOh! 暂时还没有内容!</td>
                                </notempty>
                                </tbody>
                            </table>
                            <div class="choose-page row">
                                {$_page}
                            </div>
                        </div><!-- ./smart-widget-inner -->
                    </div><!-- ./smart-widget -->
                </div><!-- ./col -->
            </div><!-- ./row -->
        </div><!-- ./padding-md -->
    </div><!-- /main-container -->
    <include file="Public:foot" />
</div><!-- /wrapper -->
<a href="#" class="scroll-to-top hidden-print"><i class="fa fa-chevron-up fa-lg"></i></a>
</body>
</html>
<block name="script">
    <script>
        $(function(){
            highlight_nav2('{:U("SchoolType/index")}');
        })

        function type_add(obj,id,status){
            $('#myModal_admin5').modal('show');
            if(obj)
            {
                $('#myModalLabel3').text('学科编辑');
                $('input[name="title"]').val(obj);
                $('input[name="id"]').val(id);
                if(status == 1){
                    $('#open_sta').prop('checked',true);
                }else{
                    $('#deal_sta').prop('checked',true);
                }
                $('#form-xiugai').attr('action','{:U("edit")}');
            }
            else
            {
                $('#myModalLabel3').text('学科添加');
                $('input[name="title"]').val('');
                $('#open_sta').prop('checked',true);
                $('#form-xiugai').attr('action','{:U("add")}');

            }
        }
    </script>
</block>

<!--学科添加  start-->
<div class="modal fade" id="myModal_admin5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"  style="margin-top: 80px">
    <div class="modal-dialog chery_dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel3">

                </h4>
            </div>
            <form  id="form-xiugai" method="post" class="form-admin15">
                <div class="modal-body">
                    <div class="right-panel-main">
                        <div class="form-group">
                            <lable class="label-form " style="display: inline-block;max-width: 100%;margin-bottom: 5px;font-weight: 700;width: 10%;">
                                学科名称
                            </lable>
                            <input class="form-control " type="text" name="title" value="{$info.title}" style="display: inline-block;width: 300px">
                        </div>
                        <div class="form-group">
                            <lable class="label-form " style="display: inline-block;max-width: 100%;margin-bottom: 5px;font-weight: 700;width: 10%;">
                                学科状态
                            </lable>
                            <input  type="radio" name="status" value="1" id="open_sta"  >开启
                            <input  type="radio" name="status" value="0"  id="deal_sta"  >禁用
                        </div>
                        <div class="modal-footer" style="text-align:center">
                            <input type="hidden" name="id" >
                            <button type="submit" class="action-button ajax-post"  target-form="form-admin15" id="sub_button3">保存</button>
                        </div>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>

